Lesson: 20 - Advanced variables and operators

Purpose : Students learn the usage of operators in programming (in addition with Motion, Looks, Basic Events, Variables).

Materials Required

Scratch software.

Prior knowledge

Students should be aware of variables and other basic programming blocks.

Exercises

Exercise:1



  1. Use the exercise-1 of Lesson 18. Create a variable and name it as Bananas. When the monkey touches the banana, increase the variable by 1. You have to change the backdrop when the variable exceeds 10 and 15. Then finish the game when it exceeds 20. (Students can create their own games like Apple catching, dog chasing ball etc.)


Exercise Video



  • Click here to view a model video for exercise 1.


    Solutions



  • Click here to download the sb3 file for exercise 1.

  • Teacher's Instruction
    1. Teachers should teach how to create variables with examples.
    2. Teachers should teach how to initialize the value of variables.
    3. Recall the lesson on RAM from last year. Mention that these variables are stored in the RAM. How these are there only as long as the program is running. This is a perfect example of temporary or volatile storage. Note also that the running program itself is also there in the RAM.
    4. Teachers should help to complete the exercise because it will be developed in further lessons.
    5. Teachers should teach operators by using simple mathematical sums before giving this exercise. (Refer lesson-11 -Exercise-1).